home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\INCLUDE\SCREEN.H < prev    next >
C/C++ Source or Header  |  1995-01-04  |  3KB  |  138 lines

  1. /*
  2.  * screen.h: header for screen.c
  3.  *
  4.  * Written by Matthew Green.
  5.  *
  6.  * Copyright (C) 1993.
  7.  *
  8.  * See the copyright file, or type help ircii copyright
  9.  *
  10.  * @(#)$Id: screen.h,v 1.6 1994/07/02 02:38:10 mrg Stab $
  11.  */
  12.  
  13. #ifndef _SCREEN_H_
  14. #define _SCREEN_H_
  15.  
  16. #include "window.h"
  17.  
  18. #define WAIT_PROMPT_LINE        0x01
  19. #define WAIT_PROMPT_KEY         0x02
  20.  
  21. typedef struct PromptStru
  22. {
  23.     char    *prompt;
  24.     char    *data;
  25.     int    type;
  26.     void    (*func)();
  27.     struct    PromptStru    *next;
  28. }    WaitPrompt;
  29.  
  30.  
  31. typedef    struct    ScreenStru
  32. {
  33.     int    screennum;
  34.     Window    *current_window;
  35.     unsigned int    last_window_refnum;    /* reference number of the
  36.                          * window that was last
  37.                          * the current_window */
  38.     Window    *window_list;            /* List of all visible
  39.                          * windows */
  40.     Window    *window_list_end;        /* end of visible window
  41.                          * list */
  42.     Window    *cursor_window;            /* Last window to have
  43.                          * something written to it */
  44.     int    visible_windows;        /* total number of windows */
  45.     WindowStack    *window_stack;        /* the windows here */
  46.  
  47.     int    meta1_hit;            /* if meta1 is hit in this
  48.                          * screen or not */
  49.     int    meta2_hit;            /* above, for meta2 */
  50.     int    meta3_hit;            /* above, for meta3 */
  51.     int    meta4_hit;            /* above, for meta4 */
  52.     int    quote_hit;            /* true if a key bound to
  53.                          * QUOTE_CHARACTER has been
  54.                          * hit. */
  55.     int    digraph_hit;            /* A digraph key has been hit */
  56.     int    inside_menu;            /* what it says. */
  57.  
  58.     unsigned char    digraph_first;
  59.  
  60.     struct    ScreenStru *prev;        /* These are the Screen list */
  61.     struct    ScreenStru *next;        /* pointers */
  62.  
  63.     FILE    *fpin;                /* These are the file pointers */
  64.     int    fdin;                /* and descriptions for the */
  65.     FILE    *fpout;                /* screen's input/output */
  66.     int    fdout;
  67.  
  68.     char    input_buffer[INPUT_BUFFER_SIZE+1];    /* the input buffer */
  69.     int    buffer_pos;            /* and the positions for the */
  70.     int    buffer_min_pos;            /* screen */
  71.  
  72.     char    saved_input_buffer[INPUT_BUFFER_SIZE+1];
  73.     int    saved_buffer_pos;
  74.     int    saved_min_buffer_pos;
  75.  
  76.     WaitPrompt    *promptlist;
  77.  
  78.     char    *redirect_name;
  79.     char    *redirect_token;
  80.     int    redirect_server;
  81.  
  82.     char    *tty_name;
  83.     int    co;
  84.     int    li;
  85.  
  86.     int    alive;
  87.  
  88. #ifdef _Windows
  89.     HWND    hwnd;
  90. #endif
  91. }    Screen;
  92.  
  93. typedef struct
  94. {
  95.     Window *which;
  96.     Screen *screen;
  97.     char    visible;
  98. }    TravInfo;
  99.  
  100. /* Stuff for the screen/xterm junk */
  101.  
  102. #define ST_NOTHING      -1
  103. #define ST_SCREEN       0
  104. #define ST_XTERM        1
  105.  
  106. /* This is here because it happens in so many places */
  107. #define curr_scr_win    current_screen->current_window
  108. #define curr_win_screen(x) ((x)->visible ? (x)->screen : screen_list)
  109. #define set_win_scr(x)  set_current_screen(curr_win_screen(x))
  110.  
  111. extern    void    scrollback_forwards();
  112. extern    void    scrollback_end();
  113. extern    void    clear_window();
  114. extern    void    recalculate_window_positions();
  115. extern    int    output_line();
  116. extern    void    recalculate_windows();
  117. extern    void    scrollback_backwards();
  118. extern    Window    *create_additional_screen();
  119. extern    void    scroll_window();
  120. extern    Window    *new_window();
  121. extern    void    update_all_windows();
  122. extern    void    add_wait_prompt();
  123. extern    void    clear_all_windows();
  124. extern    void    cursor_in_display();
  125. extern    int    is_cursor_in_display();
  126. extern    void    cursor_not_in_display();
  127. extern    void    set_current_screen();
  128. extern    void    redraw_resized();
  129. extern    Window    *get_output_window();
  130.  
  131. extern    Window    *to_window;
  132. extern    Screen    *current_screen;
  133. extern    Screen    *main_screen;
  134. extern    Screen    *last_input_screen;
  135. extern    Screen    *screen_list;
  136.  
  137. #endif /* _SCREEN_H_ */
  138.